#import <UIKit/UIKit.h>
#import "CommonConfigUtil.h"
//#import "CJSONDeserializer.h"

#include <CoreGraphics/CGGeometry.h>
#include <QuartzCore/QuartzCore.h>
#import "TilingView.h"
#import "AdvView.h"
#import "Constants.h"
#import "JXWCategoryViewController.h"
#import "MobClick.h"

 

@interface ProdListController : UIViewController<UIScrollViewDelegate,AdvViewDelegate,CategoryViewProtocol>{
    
    
    AdvView *advView;
  
    
    NSMutableArray	*prodList;//数据列表
    NSMutableData	*prodListData;//用于网络请求数据接收
    NSString *loadTpye;  //加载类型 loadBeing:开始加载 loadMore:加载更多 loadEnd:加载结束
    int  isLoadMoreEnd;//是否已经加载所有图片 0：否 1：是，为1 是不再加载更多
    //NSMutableDictionary	*imageDict;//图片MAP,以prodId为KEY值
    float colHeight1;//栏1的高度
    float colHeight2;//栏2的高度
    float colHeight3;//栏3的高度
    float maxHeight;//最大的高度
    float colHeight1_Landscape;//栏1的高度
    float colHeight2_Landscape;//栏2的高度
    float colHeight3_Landscape;//栏3的高度
    float colHeight4_Landscape;//栏4的高度
    float maxHeight_Landscape;//最大的高度
    UILabel *loadMoreTip;//加载更多的提示
    int  loadMoreImageStartRow;//开始加入图片的行数
    UIActivityIndicatorView *activityIndicator;//加载状态
    UIApplication *app;
    
    NSString *_coverpartid;//栏目ID
    NSMutableDictionary *paramsDic;
    
    int pageNum;//当前页码
    int pageSize;//页码数
 
     NSMutableDictionary *pageNumHeightDic;

      NSString *fromPage; //home, search
      BOOL landScape;
      float beginDraggingY;
      float nowDraggingY;
      JXWShoppingDelegate *jxwDelegate;
     
    NSMutableArray *reuseCellArray;//重用的cell
     NSString *_isShowAdv;//1:YES 0：NO
    UIScrollView *scrollView;
   
 //UIViewController *_jxwSegmentController;
     
}
@property (strong, nonatomic) IBOutlet UISegmentedControl *segmentControl;
 
//@property (nonatomic, assign) UIViewController *jxwSegmentController;

@property(nonatomic, retain)   UIScrollView *scrollView;
@property(nonatomic, retain) NSString *coverpartid;
@property(nonatomic, retain) NSMutableDictionary *paramsDic;

@property (nonatomic, retain) UIViewController *naviController;
@property(nonatomic, retain) NSString *isShowAdv;

-(void)initColHeight;

-(void)setAdvScrollViewFrame;
    
//请求数据
-(void)doSearch:(NSString *)loadType;

//解析数据
-(void)jsonParser;

//增加图片
-(void)addImageToScrollView;


-(void)setCellFrameValue;

-(void)setCellFrameValueWithInit:(BOOL)isInit;

- (void)updateProgress:(NSTimer*)theTimer;

-(void)addOneCellWithIndexRow:(NSInteger)i downLoadImage:(NSString *)downLoadImage;


    
- (void)updateImageToScrollView:(NSDictionary *)prodImageDic;  

-(void)setImage:(NSDictionary *)prodImageDic  ;

-(void)imageOnClickAction:(UITapGestureRecognizer *)sender;

-(void)setProdListImageViewFrame;

-(void)setProdListLandScape:(BOOL)_landScape;

-(void) reloadSubViewWithArrowType:(NSString *)arrowType;
-(void)reloadSubView;

-(void)removeAllScrollSubView;

-(void)showAllScrollSubView;
-(void) addParams:(NSString*) value forKey:(NSString*) key;
@end
